'use strict';

const db = uniCloud.database();
const collection = db.collection('medicine');

exports.main = async (event, context) => {
	const {
		_id,
		...data
	} = event;

	const res = await collection.doc(_id).update(data);


	//返回数据给客户端
	return {
		code: 0,
		msg: '编辑成功',
		data: res.data
	};
};